import styled from 'styled-components'

import {
  boxWidthBig,
  boxWidthMiddle,
  boxWidthSmall,
  backColor,
  btnColor,
  titleHover,
} from '../../config/style'

export const HomeWrapper = styled.div`
  max-width: ${boxWidthBig};
  margin: 30px auto;
  @media (min-width: 878px) {
    max-width: ${boxWidthSmall};
  }
  @media (min-width: 1102px) {
    max-width: ${boxWidthMiddle};
  }
  @media (min-width: 1310px) {
    max-width: ${boxWidthBig};
  }
`

export const HomeContent = styled.div`
  display: flex;
  flex-direction: column;
  @media (min-width: 1102px) {
    flex-direction: row;
  }
`

export const ListWrapper = styled.div`
  flex: 2.1;
  padding: 0 15px;
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
`

export const ShowWrapper = styled.div`
  flex: 1;
  padding: 0 15px;
`

export const BoxWrapper = styled.div`
  padding: 20px;
  border-radius: 5px;
  position: relative;
  box-shadow: 0px 0px 8px black;
  background-color: rgba(230, 238, 232, 0.65);
  transition: all .5s;
  margin-bottom: 30px;
  @media(min-width: 878px) {
    &:hover{
      background-color: rgba(255,255,255,0.9); 
      box-shadow: 0px 0px 50px black;
    }
  }
  .close-notice-container {
    position: absolute;
    display: inline-block;
    right: 5px;
    top: 2.5px;
    font-size: 18px;
    cursor: pointer;
    transition: color .3s
  }
  .close-notice-container:hover {
    color: ${btnColor};
  }
  .update-notice {
    color: white;
    position: relative;
  }
  .update-img {
    overflow: hidden;
    margin: auto;
    margin-bottom: 20px;
  }
`

export const TileWrapper = styled.p`
  color: white;
  text-align: center;
  .title {
    background-color:#1ec7e6;
    padding: 3px;
    margin: 2px;
    font-size: 23rem;
    border-radius: 5px;
    opacity: .8;
  }
  @media(min-width: 878px) {
    .title:hover{
      animation: ${titleHover} 3s ease-in-out infinite alternate;
      opacity: 1;
      background-color: rgba(0,0,0,0)
    }
  }
  @media(min-width: 1310px) {
    .title{
      font-size: 32px!important;
    }
  }
`

export const IntroWrapper = styled.p`
  margin: 30px;
  text-align: center;
  .people,.talk{
    background-color: rgba(10,10,0,0.7);
    margin-right: 10px;
    border-radius: 5px;
    padding: 3px 6px 3px;
    font-size: 90%;
    font-weight: bold;
    color: #ffffff;
    transition: .3s;
  }
  .talk{
    margin-right: 0px;
  }
  .people:hover,.talk:hover{
    background-color: #d9534f;
  }
`

export const ImgMask = styled.div`
  cursor: $cur-hover;
  position: relative;
  overflow: hidden;
  .mask-text{
    position: absolute;
    left:0px;
    color: white;
    display: none;
    opacity: 0;
    right: 0px;
    bottom: 0px;
    top: 0px;
    background:rgba(0,0,0,0.6);
    transition: all 1s;
  }
  img{
    width: 100%;
    height: 100%;
    transition: all .5s;
  }
  @media(min-width: 878px) {
    .img-mask:hover{
      .mask-text{
        display: block;
      }
      img{
        transform: scale(1.2);
      }
    }
    .mask-text:hover{
      opacity: 1;
    }
  }
`

export const BottomText = styled.div`
  height: 55px;
  text-align: justify;
  color: #383737;
  background-color:#eeeeee;
  padding: 15px;
  border-radius: 4px;
  border: 1px solid transparent;
  .main{
    display: -webkit-box;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-height: 18px;
  }
  @media (min-width: 878px) {
    &{
      display: none;
    }
  }
`

export const SearchWrapper = styled.div`
  background-color: ${backColor};
  padding: 8px;
  margin-bottom: 30px;
  display: ${props => {
    if (props.className) {
      return props.className.startsWith('show')?'flex':'none'
    } else {
      return ''
    }
  }};
  border-radius: 4px;
  input{
    padding: 6px 12px;
    height: 34px;
    width: 95%;
    font-size: 14px;
    vertical-align: middle;
    border-radius: 4px;
    margin-right: 10px;
    border: 1px solid #f89693;
    box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(238,88,83,0.6);
    background-color: transparent;
    outline: none;
    transition: all .3s;
    box-sizing: border-box;
    cursor: text;
  }
  input:focus{
    color: rgb(50,50,50);
    box-shadow: 0px 0px 40px black;
    background-color: white;
  }
  button{
    cursor: pointer;
    padding: 6px 12px;
    display: block;
    text-align: center;
    border: 1px solid transparent;
    border-radius: 4px;
    color: white;
    background-color: ${btnColor};
    transition: all .5s;
    outline: none;
  }
  button:active{
    background-color: rgb(211, 82, 78)!important;
  }
  button:hover{
    background-color: rgb(214, 22, 16);
  }
`

export const RightWrapper = styled.div`
  position: relative;
  overflow: hidden;
  z-index: 999;
  border-radius: 4px;
  display: ${props => {
    if(props.className) {
      return props.className.startsWith('show')?'block':'none'
    } else {
      return ''
    }
  }};
  box-shadow: 0 0px 5px #c2c2c2;
  background-color: rgba(230,238,232,0.65);
  transition: all .5s;
  margin-bottom: 30px;
  &:hover{
    background-color: rgba(255,255,255,0.9);
    box-shadow: 0px 0px 40px black;
  }
  .title{
    color: white;
    font-size: 16px;
    background-color: ${backColor};
    border-color: rgb(0, 0, 0);
    padding: 10px 15px;
    border-top-right-radius: 3px;
    border-top-left-radius: 3px;
  }
  .talk{
    display: flex;
    justify-content: space-between;
    .roate{
      transform: rotate(90deg)!important;
    }
    .ico-box{
      span:first-child{
        transition: all .5s;
        display: inline-block;
        transform: rotate(-90deg);
        margin-right: 5px;
      }
      span:hover{
        color: ${btnColor};
        cursor: pointer;
      }
    }
  }
  .talk + .yin{
    max-height: 0px;
  }
`

export const LoginMain = styled.div`
  padding: 30px 20px;
  .forget-password{
    text-align: right;
    color: #3d4450;
    font-weight: bold;
    padding: 2px;
    font-size: 14px;
  }
  .forget-password:hover{
    cursor: pointer;
  }
  .login-btn {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    a {
      display: inline-block;
      width: 100%;
      height: 100%;
      text-decoration: none;
      color:white;
    }
  }
  button{
    font-size: 16px;
    float: left;
    user-select: none;
    width: 48%;
    padding: 10px;
    padding: 10px 10px;
    margin-bottom: 0;
    font-size: 12px;
    font-weight: normal;
    line-height: 1.428571429;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: $cur-hover;
    background-color: ${backColor};
    color: white;
    transition: all .3s;
    border: 1px solid transparent;
    border-radius: 4px;
  }
  button:hover{
    background-color: ${btnColor};
    color: white;
    transition: all 0.3s ease 0s;
    border-color: ${btnColor};
  }
`

export const LoginInput = styled.div`
  display: flex;
  margin-bottom:20px;
  .login-ico{
    flex:1;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgb(217, 83, 79);
    color: white;
    border: 2px solid rgb(217, 83, 79);
    padding: 6px 6px;
    font-size: 14px;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
  }
  input{
    flex:10;
    width: 100%;
    height: 34px;
    padding: 6px 6px;
    box-sizing: border-box;
    font-size: 16px;
    line-height: 1.428571429;
    color: #111111;
    vertical-align: middle;
    background-color: transparent;
    border: 1px solid #f89693;
    box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(238,88,83,0.6);
    border-left-width: 0px; 
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
    outline: 0;
  }
  input:focus{
    color: rgb(50,50,50);
    box-shadow: 0px 0px 40px black;
    background-color: white;
  }
`

export const UserItem = styled.div`
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 0;
  button{
    display: inline-block;
    padding: 6px 12px;
    margin-bottom: 0;
    font-size: 14px;
    color: white;
    font-weight: normal;
    line-height: 1.428571429;
    text-align: center;
    background-color: rgba(10,10,0,0.7);
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 4px;
  }
  button:hover{
    transition: all .3s ease;
    background-color: #d9534f;
    border-color: #d9534f;
  }
  span{
    color: #3d4450;
    margin-right: 20px;
    font-size: 14px;
  }
  span:hover{
    color: #db5450;
  }
  img{
    width: 54px;
    height: 54px;
    border:0;
    margin-right: 20px;
    border-radius: 50%;
    border: 2px solid white;
    background-color: white;
  }
  img:hover{
    transition: all .3s ease;
    -webkit-transform: rotate(360deg);
    -moz-transform: rotate(360deg);
    transform: rotate(360deg);
  }
`

export const TalkWrapper = styled.ul`
  transition: all .5s;
  overflow: hidden;
  max-height: 800px;
  @media(min-width: 1102px){
    .text{
      max-width: 247px;
    }
  }
  .close{
    max-height: 0;
  }
`

export const TalkItem = styled.li`
  display: flex;
  padding: 10px 15px;
  align-items: center;
  border-bottom: 1px solid rgb(221,221,221);
  font-size: 12px;
  color: rgb(73,77,105);
  background-color: rgba(230,238,232,0.3);
  @media (min-width:878px){
    &:hover{
      
    }
  }
  &:hover{
    transition: all .5s;
    box-shadow: 0px 0px 50px black;
  }
  &:last-child{
    border: 0px solid red;
  }
  .author-avatar{
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    img{
      width:100%;
      height: 100%;
    }
  }
  .author-avatar:hover{
    transform: scale(1.25);
    transition: all 0.3s ease 0s;
  }
  .text{
    line-height: 20px;
    background-color: rgb(238, 238, 238);
    border-radius: 4px;
    padding: 8px;
    margin-left: 10px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    width: 80%;
  }
`

// export const